Refactor to prevent paging