pagination? and refactoring