Added base class and serialization functions