added comments, ngDoc, tests refactoring