Half way through refactoring