Continous refactoring

Getting ready for adding the database layer