Some optimizations
A lot of work has been done.