Refine moving logic