major refactor of Key (and saved about 1kB)