Set main func in class