refactor stuff around and clean up