Auto-fixes from Scritinizer
Reduce duplicate code