refactorization of turn implementation