refactored turn functionalirt