[redirect] splite code into several functions
[redirect] splite code into several functions

ouistiti-project/ouistiti,ouistiti-project/ouistiti,ouistiti-project/ouistiti,ouistiti-project/ouistiti,ouistiti-project/ouistiti,ouistiti-project/ouistiti