Fixing collision and separating logic