extracted name and namespace logic into method, merged both methods that handled name and namespace logic for aggregation and dependency into one method