potentially wrapping Marshal into a nicer api