Restructure CSS and javascript