Small adjustments and optimizations