cleanup, refactor, comments