refactor statistics last user to doctrine