Refactor for user-provided constants support