config vars and cleanup