Remove unnecessary modules.