naming cleanup and some optimizations