optimise mkdir commands