codec implementation for serialization implemented