refactor methods for redirect response