Gonna rewrite without server dependence