refactors the wrapping to use the fmt package