move script functions to bitcore