More refactoring on quote calculations