improving encapsulation for easier refactoring