Refactors backend.