refactor with encapsulation in mind