code quality and minor changes