move functions in js