Refactoring of backend into separate module complete.