Some code moved to new class