Refactor single item detection method