fixed constructor
improved encapsulation