Refactoring code.

- Handling errors through new KeyError class.
Renaming method.