Completely refactored tests