Move registerExtension call to the top