refactored to remove bad dependencies