mass refactor, all still WIP