Optimizations to reduce binary size, hopefully doesn't break anything.