Head-file setup and clean-up