Adding behavior to inner class