isn't this the responsitility of the yml/xml/annotation loader? i am pretty sure that this is already happening for most of the cases, so we would need to cleanup elsewhere if we move it all here.