New tests and refactored some existing ones