refactor post creation