Refactored tests a lot