refactor blog controller