Split off handler logic