Part way through refactor