refactor tunnel.go and controller.go, remove duplicated lines. Signed-off-by: Xiao Deshi <xiaods@gmail.com>