code duplication refactor: use get_allocation_for_path