more cleanup from convert and added new analytics code