Refactorings to be closer to a nice solution.