Refactored the admin JS.