Refactor graph url generator