Refactored tests and removed getAttributesKey function