Separate logic to new class