Refactored by adding JPA