make graph entity more OO