moved implementation details of list::head into a separate file