Refactor using Groovy splat operator