refactored, task timeout, more flow parsing