refactor mv countdown to a function