Cleanup and Add tests