Extract quote parsing into a method
Simplify branching