restructuring engine lib to log more detailed information