Optimizations

just make a few code cleanups