General configuration and cleanup