Improve code quality in check-anonymous