Misc code cleanup and backup