Pre javascript rehaul