organize logic according to the execution order