cleanup code and docs