convert some fields to locals vars