Performance changes - add debounce for resize, cache container elements