Code cleanup with solutions