Small fixes for better encapsulation