getClass optimized