cleanup framework, genericize it for web