removed paging code comments.
refactored database code.