regcode cleanup