Registration refactors and javascript refactors