Optimise redirection
Code clean-up