refactored tests