Refactor and implement retrieve filter