move module logic out of the sandbox