Code clean up and docs + PIT