move some sub class, change to inner class.