Replace 'magic number' buffer sizes with named constants