Refactor common jpa package