Refactor code for policy post.