Console.log and other code cleanup