Tying it all together to building a gateway