Extracting code related to items on lifcycle to a specific file