move functions to staticlib