refactor of conversions