generalise code to read in settings file and added keymap