put reused code into superclass
Merge remote-tracking branch 'origin/master'