Refactor & CS fixes.