try to optimize memory usage & layout