a convencience function to get everything working nicely :)
storable instance for CInMemoryBuffer
storable instance for the state