first version of persistence layer