code cleanup
fixes #1