Refactored OPF id handling.