some refactoring and work on tests