Cleaning up code and Updating Docs

* Adding comments to the detector file
* Refactoring detector file
* Adding limit as constant
* Removing instanve variables in test where not needed
* Moving self methods to class << self