Move function refactor