added a data cleanup method
adapting queue for html
refactoring