FIrst cut refactoring