Fix widget searches (drugs, treatments, etc.) and some refactorings