Optimize implementation of 'createClass'.