if we change to constructor then this pieve of code could be removed.