RESTRUCTURE application AND ADD message logging functionality