refactored posts#index. TODO: posts#show