Refactoring to use a method handler.