Refactoring moveForward and mmoveBackward