started writing tests, modularizing