small refactorings, and using lens operators. fun :)