receiving head from server, refactoring
receiving head from server, refactoring