changes and optimizations