rewrite with Object.defineProperty()
updated tests and dist