Refactored the up/down functions