Refactor to prepare for test runners