first part of large capability code cleanup