This fixes errors (former warnings) in several locations.
This is actually a domain library and thus should be put into the lib/domain/ folder.