Structural improvements

Fixes #18