format text and delete some useless control prints