added proper clustering support