Minor code duplication removal with Groovy magic (aka traits)