Replaced inner class with anonymous inner class