clean up padded buffer size calculations