Refactor the post task