cleanup and markup