Remove unnecessary constants and range checks