Refactor for PR #26