Updated logger to be more efficient