little refactor according to review