Moved entry_name extraction into a method.