Minor refactoring
Export sproxy as a library