Mostly cleanup with some added niceties and improvements in readability