Refactoring e redirect.