started first draft of refactoring