Consolidate code