pagination and refactoring.
CSRF protection