Fix limit filter WRT 'retrieve limit' and refactor