Move functions from "Remove Trailing..." program