unite code concerning object state in inner class of object.