Code cleanup and fixing Head() method