Simplify code.
CR feedback.
Update tests.