massively restructured backend to be more modular