Merge pull request #8 from benjamin-surma/master

Code cleaning and memory usage optimization