refactory of convert tools