extract format functionality so it can be redefined if required
remove redundant import statement