Apply jim17's suggestions