refactor and stub out tests a bit more