Intermitten cleanup and refactoring