Move attribute persistence to its own file