rename funcs and types, fix #2