Remove unneeded modules and add new ones.