Refactoring of use of velocity