refactor to break up giant single class