refactor tests to reduce code duplication
fixed comments