Remove module related code paths, cleanup some unused parts.