Separate find process into functions