starting to refactor.