moving all magic numbers into template