Optimizations in Modal class.