avoid code duplication
add string_compat mode
function as extension
missing tests