a few subtle design changes and optimizations