Improve bsbport flash and memory usage