Moved class registration to separate function, added a new required variable