some optimizations, mostly useless