dom pattern improvements