Minor refactoring of create-posts