refactored quotes controller