CS
Code cleanup and inline docs