Small refactorings + pick redirect end-point from config