Break detect_anomalies method in SpikeDetector into smaller ones