[refactoring] Add dynamic method definition.