some redesign and preformance improvements