More Simn cleaning.
Clean up optimisations to be applied in main.ml to be more flexible.