extract format functionality so it can be redefined if required
remove redundant import statement
Merge pull request #1 from signalpillar/master

Extract ``format`` functionality