Refactored constants logic.