Restructured to fit dependency injection with Repository and Services