settings and cleanup