gitignore.
Moved function to be static and reusable.