move methods around and use idVisible js method