Style changes suggested by @parkr, removed the gem changes and a few other simplifications