Starting to clean up the code, worked mainly on the initialization code