refactored and fixed tests