code refinement in JPAManager class