Study could offer a new way to treat Type 1 and Type 2 diabetes