Added pagination. Could be refactored into a mixin.