refactor require config js
throws exception instead od null return
Fix tests