refactoring and fetching entities on page selection