extracted both methods to new class