cleanup - convert to js