optimizations due metanota comments