Refactored advance-turn, and cut out unnecessary ref-set