Restructure and added stats keeping