refactor transferCommand