Code update with some stuff for persistence