Some tests moved into separate functions.