minor logic and comment cleanup