Refactoring PostController to be more efficient.