Memory footprint optimization

Updated tests and documentation accordingly.