Just some tidying up for consistency
Moves the declaration of datasize to the scope that it's used within. This also takes the opportunity to apply const where applicable, and make early-exits all vertically consistent with one another.
Makes namespacing a little less noisy