Reduce redundancy in code and move all static values to constants