some cleanup and testing