dependency injection principle using constructor