Refactoring vector direction