Add generic main method.