Move getType to a utils file