Code cleanup with messages