Refactor to comply with changes added in PR #1575