Improved serialization and database handling.