Implement pagination, minor style update and refactoring