Huge class refactor