Add more tests and clear database function