Limited support for gadgets
Cleanup and more support for gadgets