Refactored to share utility functions.
Refactored the gitignore entry to be more strict.