config: add helper function for parsing key names