Refactoring to use TypeHandlers.