Optimized class construction