move bom search code to a script