This part of code has several duplicate segments and let's try to get it concise.
 1. Can we define periodObj at the top and just reuse this object (BTW, a better naming wanted!, like defaultPeriodSymbol).