Big refactor changing the full structure from modules grouping functions to classes.