Improved serialisation