Refactored exsisting tests; added new tests