refactor some of the things