make functions private where appropriate.