migrate direction refactoring