moving graph creation bit by bit to enable db based layout for graphs