Optimize the way of defining Class