refactored define method using internal definition ref
developed limit, sort and skip queries