small code optimizations.