fix for #2 (some cleanup)