Refactor CS5700

1. Reformat code files
2. Make some minor changes