Refactoring to incorporate graph view