Minor refactoring and added check for ADD/UPDATE/REMOVE from git