Clean up command and event publishers and remove unnecessary configuration.