Modified Timer inner class to anonymous class