Refactor to support various config element types