rearranged variable assignment in visaulizer directive to a more logical order