cleanup and add missed tests