Refactor configuratable allowed root elements

Change-Id: I018b2098f199023e128b7161067473615b223789