cleanup and more stuff from Paul Irish