Improve type convertion