Decompose tasks and flows by independent modules