Small refactoring, added test for find_latest