Some simulation tweaks
Refactor to improve profiling