Tried to abstract some parts of the keymapper classes.