Refactored tests to speed them up.