remove setup for gateway
reformat code