Refactor on K-means processor to improve its performance around 50%