Standardize close functions