Some refactoring, still working on SoftGS and soft_csp_next