Refactor servlet with applicationContext and hibernate.cfg