Refactor blog controller