Layering and abstraction over marshalling. Work in progress though