little refactoring and changing registration