new detection method, clean code