Combining the code into bigger chunks.  It is a bit more confusing but I think it will help with me not knowing node so well.