separated byte array concatenation into its own method