Refactor to common post module

Bit of a tidy up and refactoring!