Improved approach of checking constant.