potential better way added as comment