Improved RPG, Code clean and memory leak checks needed