All tests passing, needs some refactoring