renamed default $type to 'runmode' for readability