Remove redundant var and fun