Refactored tests a little