Organize instance source

Rough priorities for order:
* type
* visibility
* functionality