Combine backend into one function