refactor convert function to be static function rather then a template