First version of persistence layer