Reusable Scala code from SnowPlow Analytics