fix some __FILE__ hocus pocus with dependency injection