refactor some things