refactoring social networks controllers