slight clean up of js