adapted Car class to use dependency injection design pattern