Refactoing out grabbing data from the head