Remove unnecessary components from data string