Code cleanup

Fixes #3