Use C++ headers where possible
Put local helper functions in anon namespace