Some small code size optimizations.
Small optimization.
Code size optimizations, and factoring out the blending logic into a separate module for improved re-use potential.