Optimizations

Removed unused code