Refactor the code related to constants