remove unused properties and update comments
change a function in function to a var of function type