These optimization can't really be in encode! i think, because encode! should encode, and what we want to do with these optimizations is preventing having to change the encoding if we don't have to.