Refactor add data to post