refactoring action serialization - getting rid of ostringstreams