Refactor and beginning of SCEP