big refactor of all the shit