refactor with facade pattern