Re-arrange some code to minimize diff between maze & karel