Refactor the code of SDCController