normalize repeated instances of code as follows: