def installed? was unnecessary.  WebPI already gracefully handles this scenario, and what is better about this is that it installs any missing dependencies automatically.