various work, reducing mem alloc/dealloc etc