Moving away from PHP and writing it in JS like a fucking KING.