Refactored GraphManager class