Move anonymous instantiation to inner class.