Better implementation of toTrusted