Refactor, tests not 100%

closes #4