moving repeted variables into constant