Refactoring some unit tests

@fredericaltorres Can you please take a look at this PR, this is what I meant with my comments. What do you think?