js files code cleanup