Small Improvements

A bunch of small improvements to make the code more SSS (simpler, smaller, smarter).