Refactoring

Getting things a bit more in order