merge @jasonmanners changes, some cleanup