refactor using JpaRepository