more changes to decrease jquery dependency