A little refactor and additions