[backend] make code nicer