[#2426] Refactor getAttributes and setAttributes.