Improve constant generation