restructured code for config extension