modify for better cpp experience.