New implementation of persist
changed names of somes classes