refactoring to improve clarity
Tests are starting to go green
yet another migration