Messy start of total refactoring