General update and code cleanup