standardize code functions