Refactor PersistenceContext