Added Memory Protection + Light Refactor