Improve some code quality