split EM and non-EM specific code