Add gen-csr, cleanup
More cleanup