refactor to use limit