Clean up the code inside Posts controller