Refactored tests a bit