Unit tests passing, committing refactoring for now