clean up, refactor, comments