cleanup and improve documentation