use dplyr, create factors and get ready to use aggregation