Cleaned up code in PostsController