a little refactor to hold back the inf loop