Code cleanup & formatting