code refactoring and friends detail page