refactor ALL THE THINGS