move lowlevel functions to backend-specific modules