Some cleanup and adding some common-sense bits