misc code cleanup... removal of cruft and clarifications