Refactoring - moved quota related functions into quota class.