tests passing; requires refactor/clean up