Simplify code to equivalent code. No need to test for null after cast<>, use
takeAs<> instead of cast<>(.take()). Fix 80-column violation in whitespace after
comment.