Remove: unnecessary if statement
Remove: deprecated method

Use register() instead