general cleanup, polishing and docs