Broke down the MERGE statements into more sensible pieces after feedback from SA