WS: refactored getEM code
Added JNDI templates