split main from system class definition