cleanup and add a test