Changes following second code review to #48