Best Practice Guide - The "process_resident" function