eod - working on tests and some refactoring