add design parttern singleton and observer