small optimizations.
code simplification and optimization.