some cleanup based on Jco's comments