Added more unit tests and they were a bit refactored to a nicer form.