refactored handlers to eliminate smells.