current state after lots of optimizations and simplifications