a little optimization on speed