A way to improve it is to use ZettelKasten note taking to detail the problems in tackling the problem so that when you wake up you can review those notes before re-examining your approach to the problem...
I started using this approach about 20 days ago...came up with new software architecture beyond cleanarch due to this new using of those techniques.