Significant refactoring to make the codebase more easy to update and maintain.