Refactoring: dictionary of methods is used