improve speed of find_by and find_all_by methods for repositories