Code refactoring for OR-TAPI mapping