#31 moved determineType to separated service