started doing some refactoring