Add anonymous class constructor method