Added clasterizing and make refactor.