Code refactoring, comments and unit tests

Removed target folder
Added unit tests
Added comments
Code Refactoring