Removed unused code.
Improved memory and CPU utilisation.