Clean and test code