Attempt to split up command line and main code