turn flow refactored