Re-code the whole framework (Stage 1)