cs solution detection: some restructuring/cleanup