this is the third time this exact block of code has come up. decompose please