type convertion utils and a small testing frame