split trap code