Refactor Castor connector to use Portability.