Refactoring KeyName class.