Refactored get_name to return char*