minor refactoring and added docs

* Minor Refactoring of API usage
* Moved string variable to constants
* Added some docs