cleaned up javascript stuff