Poc/memory leaks

This is mostly for review and should not be merged as is to the master