refactored sequence marker detection