fix for #411
converted to case classes