Small refactoring
Fix performance bug. Unsubscribe from commit events when commits isn't used