Solution preparation commit and slight refactoring.