big refactor of the project