begun refactoring