bug fix/encapsulation