WIP with changes from code review.