I take it this was redundant/over-complicated and could be folded into the code below?