Added some encapsulation