Refactor `Serializer` and `Parser` to simplify API