remove visitor pattern
reformat code