reworking attribute serialisation