beginning to refactor