More refactoring... start to allow for pagination.