Consolidate handler logic