refactored post controller actions