Refactored snippet generators with shared behavior in common parent class