refactoring $per_page to PER_PAGE constant