Some preparation work for compressing the clear-to-defaults function.