scala traits for json process definition