added comment, refactor, correct tests