code cleanup
fixes #21