Reworked KeyObject class