Major framework refactor