Rewrite test to make them test smaller parts of the code