Model cleanup

Cleaned up model, adding element types should be easier
Bugfix

nodes would go out of scope