XWare: a Middleware for Smart Retrofitting in Maintenance