Copy from daniel-beard only for test