simplify some functions
Update example