Better redirect implementation