rename psc base and refactor little (not tested)