clean code for initial processing of sentences