Cleaning up environment variable and settings handling.