Improve further performance and switch to Appender instead of an normal array.