Added better documentation
Refactoring