refactor complete, tests passing