refactored post data processing and page building in order to separate concerns