Completed code cleanup