refactor stuff