doing optmizations