Refactor to reduce abstraction