Separate the functionality of clean db after example; Add tests