refactoring of the detection service

- removing unused functions
- add the doc in comments