Cleaned up some methods, Added logic to enable and disable logging