refactor with defineProperty