Refactored graph control