Change position of function in source code.
Factorize code to generate a simulation from a scenario.