cleanup and better object detection for dynamic data