some refactoring and new is_coll function