refactor old redirect method