Maybe the contained functions can be defined more locally, maybe there are better names for the headers...