code format corrections and move js into admin.js