removes unneeded files, breaks down and adds representations as nested form