little refactor of registration