Refactor out responsibilities into their own modules