Remove unnecessary substring.