Backend logic cleanup, #1.