write: remove useless cast
write: Ref type
types: remove Node type, just use Atom
read: make specific type readers private (makes no sense to have them public anyway)