Moved WM logic to backend structure