moved to z_setup