refactor socket file and show method in user controller