Refactoring in preparation for TODO implementation