Solves 1.2, refactors 1.1