refactor to redirect