Extracted speech recognition logic to new class