minor cleanings and optimizations