implement file serialization + misc