Partial commit - Refactoring the main framework