Move commonly used configuration switch reader function into core.