cleanup and plugins architecture