Converted lengthy anonymous inner to named inner class.