refactorized find_by_name