refactor out new class