microrefactoring and em tag processing added