DataManager: Refactor by making a new private method
Make new private method, and use it from three places, to avoid code
duplication.
Make some public static methods private static, since they
are only used internally in the class.