refactory and enhancement of the Hibernate Dao