refactor bg
little refactoring