refactored tests, added new tests