refactor out generalized parts

I have taken the liberty to start refactoring out parts.
I think this will make the code easier to navigate & understand & contribute to.

The date formatter was a low hanging fruit, i think there are other parts we could pull out too.