Simplified based on comments in PR #44