You have an ASP.NET Core application where business logic is tightly coupled within API controllers and relies heavily on direct database access . How would you refactor this to improve separation of concerns , enhance testability , and potentially leverage Azure services like Azure Functions or Azure SQL Database more effectively?