redirect url moved to constants, code refactoring