Remove duplicate code in moveUp/modeDown