~ improved memory handling