some minor changes to improve code quality