style improvements and typo fixes