Javascript code cleanup.