remove duplicated code from admin/posts controller