Encapsulation and minor changes