There is quite alot of repeated code in the tests. Some setup, tear down functionality would be nice.