Refactored common graph implementations