no need to call Em.typeOf multiple times.
use a switch statement over if/else
use unless over if
remove redundant stuff.