use logging and cleaning text