Refactor: pull out logical_to_physical.