starting to refactor