vectorize and cleaning