Refactor in response to #78