Some optimzations