Code cleanup
Fixes #23