clear cruft and validate config