reorganizing some js