This block and the block above is identical, we can probably consolidate this quite a bit.