Fix: The way we tested if a ref/id already exists was wrong. Introduce a
common static method for this. Removed verifNumRef method.
Fix: Add missing logs