Clean up `check` function in tool analysis package.
A bit of cleanup