Scope handling extracted into a new class