clean and doc. use as module.