Refactoring on positioning funcitons