cleanup & organize viz code