Define sub classes correctly