refactored tests somewhat