Refactor framework implementation (using a dynamic polymorphism)