optimise data structure