optimise gene graph creation