Indentation fixes
Some code refactoring on pagination